package com.baidu.service.impl;

import com.baidu.entity.User;
import com.baidu.mapper.UserMapper;
import com.baidu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户service层实现类
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    /**
     * 查找用户信息
     */
    @Override
    public List<User> getUserInfoAll() {
        //调用mapper层查询用户信息
        List<User> list = userMapper.getUsersInfoAll();
        return list;
    }

    @Override
    public User UserLogin(User user) {
        //调用mapper层使用登录方法
        User user1 = userMapper.UserLogin(user);
        return user1;
    }
}
